#define _CRT_SECURE_NO_WARNINGS 520
#include<stdio.h>

int bin_search(int arr[], int left, int right, int key)
{
	while (left <= right)
	{
		int mid = (left + right) / 2;
		if (arr[mid] == key)
		{
			return mid;
		}
		else if (arr[mid] > key)
		{
			right = mid - 1;
		}
		else if (arr[mid] < key)
		{
			left = mid + 1;
		}
		
		
	}
	return -1;
}


int main()
{
	int arr[20] = { 0 };
	for (int i = 0; i < 20; i++)
	{
		scanf("%d", &arr[i]);
	}
	int sz = sizeof(arr) / sizeof(arr[0]);
	int left = 0, right = sz-1;
	int key = 0;
	scanf("%d", &key);

	int index = bin_search(arr, left, right, key);

	if (index != -1)
	{
		printf("%d", index);
	}
	else
	{
		printf("-1");
	}
	return 0;
}